<?php defined('SYSPATH') or die();?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>思途CMS{$coreVersion}</title>
    {template 'stourtravel/public/public_min_js'}
    {php echo Common::getCss('style.css,base.css,base2.css,base_new.css'); }
    {php echo Common::getScript('config.js');}
</head>
<body>

    <table class="content-tab">
        <tr>
            <td width="119px" class="content-lt-td" valign="top">
                {template 'stourtravel/public/leftnav'}
                <!--右侧内容区-->
            </td>
            <td valign="top" class="content-rt-td" style="overflow-x:hidden;">
                <div class="cfg-header-bar">
                    <a href="javascript:;" class="fr btn btn-primary radius mt-6 mr-10" onclick="window.location.reload()">刷新</a>
                </div>
                <div class="clearfix">
                    <form id="configfrm">
                        <table class="table table-bg table-hover" id="day_tab">
                            <thead>
                            <tr class="text-c">
                                <th scope="col" width="50%" align="center">注册字段名称{Common::get_help_icon('cfg_member_reg_company_field_name')}</th>
                                <th scope="col" width="50%" align="center">是否使用</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-c">
                                    <input type="text" name="cfg_member_reg_company_field_name" class="input-text w80" value="{$config['cfg_member_reg_company_field_name']}"/>
                                </td>
                                <td class="text-c">
                                    <input type="checkbox" id="box_required"  {if $config['cfg_member_reg_company_required']==1}checked="checked"{/if}  value="1"/>
                                     <input type="hidden" name="cfg_member_reg_company_required" value="{$config['cfg_member_reg_company_required']}"/>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
                <div class="clear clearfix pd-20">
                    <a class="btn btn-primary radius size-L ml-20" href="javascript:;" id="btn_save">保存</a>
                </div>
            </td>
        </tr>
    </table>

<script>

    $("#box_required").click(function(){
        var val = $(this).is(":checked")?1:0;
        $("input[name=cfg_member_reg_company_required]").val(val);
    });

    //配置信息保存
    $("#btn_save").click(function(){




            var title = $('input[name=cfg_member_reg_company_field_name]').val();
            if(title=='' || !title){
                ST.Util.showMsg('名称不能为空',5,1500);
                return false;
            }

            if(title.length>4)
            {
                ST.Util.showMsg('名称不能超过4个汉字',5,1500);
                return false;
            }


           Config.saveConfig(0);
        }
    );
</script>

</body>
</html>
